﻿// -----------------------------------------------------------------------
// <copyright file="Db.cs" company="JSC Centido">
//  Copyright (c) JSC Centido. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

namespace Centido.Core
{
    /// <summary>
    ///   Database related constants.
    /// </summary>
    /// <remarks>
    ///   This class is a central place of storing all database related constants.
    /// </remarks>
    public abstract class Db
    {
        /// <summary>
        ///   Database procedure constants.
        /// </summary>
        public abstract class Procedures
        {
            /// <summary>
            ///   The name of the procedure that returns the current database name.
            /// </summary>
            public const string GetDbName = "meta_get_current_db_name";

            /// <summary>
            ///   The name of the procedure that returns the database management system name.
            /// </summary>
            public const string GetDbmsName = "meta_get_dbms_name";

            /// <summary>
            ///   The name of the procedure that returns the database management system version.
            /// </summary>
            public const string GetDbmsVersion = "meta_get_dbms_version";

            /// <summary>
            ///   The name of the procedure that creates a new user-defined table.
            /// </summary>
            public const string AddTable = "meta_add_table";

            /// <summary>
            ///   The name of the procedure that deletes a user-defined table.
            /// </summary>
            public const string DeleteTable = "meta_delete_table";

            /// <summary>
            ///   The name of the procedure that renames a user-defined table.
            /// </summary>
            public const string RenameTable = "meta_rename_table";

            /// <summary>
            ///   The name of the procedure that creates a string table column.
            /// </summary>
            public const string AddStringColumn = "meta_add_string_column";

            /// <summary>
            ///   The name of the procedure that deleted a table column.
            /// </summary>
            public const string DeleteColumn = "meta_delete_column";

            /// <summary>
            ///   The name of the procedure that sets string column default value.
            /// </summary>
            public const string SetStringColumnDefaultValue = "meta_set_string_default";

            /// <summary>
            ///   The name of the procedure that sets table column nullability.
            /// </summary>
            public const string SetColumnNullability = "meta_set_column_nullability";

            /// <summary>
            ///   The name of the procedure that sets string column emptiness.
            /// </summary>
            public const string SetStringColumnEmptiness = "meta_set_string_emptiness";

            /// <summary>
            ///   The name of the procedure that sets string column maximum length.
            /// </summary>
            public const string SetStringColumnMaxLength = "meta_set_string_max_length";

            /// <summary>
            ///   The name of the procedure that sets string column regular expression.
            /// </summary>
            public const string SetStringRegularExpression = "meta_set_string_reg_exp";

            /// <summary>
            ///   The name of the procedure that renames a table column.
            /// </summary>
            public const string RenameColumn = "meta_rename_column";

            /// <summary>
            ///   The name of the procedure that created a reference table column.
            /// </summary>
            public const string AddReferenceColumn = "meta_add_ref_column";

            /// <summary>
            ///   The name of the procedure tha sets reference table column default value.
            /// </summary>
            public const string SetReferenceColumnDefaultValue = "meta_set_ref_default";

            /// <summary>
            ///   The name of the procedure that creates a reference table column target.
            /// </summary>
            public const string AddReferenceTarget = "meta_add_ref_target";

            /// <summary>
            ///   The name of the procedure that deleted a reference table column target.
            /// </summary>
            public const string DeleteReferenceTarget = "meta_delete_ref_target";

            /// <summary>
            ///   The name of the procedure that enables or disables reference checking trigger.
            /// </summary>
            public const string SetReferenceChecking = "meta_set_ref_checking";

            /// <summary>
            ///   The name of the procedure that creates an enumaration table column.
            /// </summary>
            public const string AddEnumColumn = "meta_add_enum_column";

            /// <summary>
            ///   The name of the procedure that creates an enumeration table column member.
            /// </summary>
            public const string AddEnumMember = "meta_add_enum_member";

            /// <summary>
            ///   The name of the procedure that deletes an enumeration table column member.
            /// </summary>
            public const string DeleteEnumMember = "meta_delete_enum_member";

            /// <summary>
            ///   The name of the procedure that sets an enumeration table column member value.
            /// </summary>
            public const string SetEnumMemberValue = "meta_set_enum_member_value";

            /// <summary>
            ///   The name of the procedure that sets enumeration table column default value.
            /// </summary>
            public const string SetEnumDefaultValue = "meta_set_enum_default";

            /// <summary>
            ///   The name of the procedure that enables or disables value checking constraint.
            /// </summary>
            public const string SetEnumValueChecking = "meta_set_enum_value_checking";

            /// <summary>
            ///   The name of the procedure that creates a decimal table column.
            /// </summary>
            public const string AddDecimalColumn = "meta_add_decimal_column";

            /// <summary>
            ///   The name of the procedure that sets decimal table column minimum value.
            /// </summary>
            public const string SetDecimalMinimum = "meta_set_decimal_minimum";

            /// <summary>
            ///   The name of the procedure that sets decimal table column maximum value.
            /// </summary>
            public const string SetDecimalMaximum = "meta_set_decimal_maximum";

            /// <summary>
            ///   The name of the procedure that sets decimal table column precision.
            /// </summary>
            public const string SetDecimalPrecision = "meta_set_decimal_precision";

            /// <summary>
            ///   The name of the procedure that sets decimal table column scale.
            /// </summary>
            public const string SetDecimalScale = "meta_set_decimal_scale";

            /// <summary>
            ///   The name of the procedure that sets decimal table column default value.
            /// </summary>
            public const string SetDecimalDefaultValue = "meta_set_decimal_default";

            /// <summary>
            ///   The name of the procedure that creates a datetime table column.
            /// </summary>
            public const string AddDateTimeColumn = "meta_add_datetime_column";

            /// <summary>
            ///   The name of the procedure that sets datetime table column maximum value.
            /// </summary>
            public const string SetDateTimeMaximum = "meta_set_datetime_maximum";

            /// <summary>
            ///   The name of the procedure that sets datetime table column minimum value.
            /// </summary>
            public const string SetDateTimeMinimum = "meta_set_datetime_minimum";

            /// <summary>
            ///   The name of the procedure that sets datetime table column default value.
            /// </summary>
            public const string SetDateTimeDefault = "meta_set_datetime_default";

            /// <summary>
            ///   The name of the procedure that creates a boolean table column.
            /// </summary>
            public const string AddBoolColumn = "meta_add_bool_column";

            /// <summary>
            ///   The name of the procedure that sets boolean table column default value.
            /// </summary>
            public const string SetBoolDefault = "meta_set_bool_default";

            /// <summary>
            ///   The name of the procedure that creates a binary table column.
            /// </summary>
            public const string AddBinaryColumn = "meta_add_binary_column";

            /// <summary>
            ///   The name of the procedure that creates an integer table column.
            /// </summary>
            public const string AddIntColumn = "meta_add_int_column";

            /// <summary>
            ///   The name of the procedure that sets integer table column default value.
            /// </summary>
            public const string SetIntDefault = "meta_set_int_default";

            /// <summary>
            ///   The name of the procedure that sets integer table column maximum value.
            /// </summary>
            public const string SetIntMaximum = "meta_set_int_maximum";

            /// <summary>
            ///   The name of the procedure that sets integer table column minimum value.
            /// </summary>
            public const string SetIntMinimum = "meta_set_int_minimum";

            /// <summary>
            ///   The name of the procedure that creates a big integer table column.
            /// </summary>
            public const string AddBigIntColumn = "meta_add_big_int_column";

            /// <summary>
            ///   The name of the procedure that sets big integer table column default value.
            /// </summary>
            public const string SetBigIntDefault = "meta_set_big_int_default";

            /// <summary>
            ///   The name of the procedure that sets big integer table column maximum value.
            /// </summary>
            public const string SetBigIntMaximum = "meta_set_big_int_maximum";

            /// <summary>
            ///   The name of the procedure that sets big integer table column minimum value.
            /// </summary>
            public const string SetBigIntMinimum = "meta_set_big_int_minimum";

            /// <summary>
            ///   The name of the procedure that creates a small integer table column.
            /// </summary>
            public const string AddSmallIntColumn = "meta_add_small_int_column";

            /// <summary>
            ///   The name of the procedure that sets small integer table column default value.
            /// </summary>
            public const string SetSmallIntDefault = "meta_set_small_int_default";

            /// <summary>
            ///   The name of the procedure that sets small integer table column maximum value.
            /// </summary>
            public const string SetSmallIntMaximum = "meta_set_small_int_maximum";

            /// <summary>
            ///   The name of the procedure that sets small integer table column minimum value.
            /// </summary>
            public const string SetSmallIntMinimum = "meta_set_small_int_minimum";

            /// <summary>
            ///   The name of the procedure that creates a new guid table column.
            /// </summary>
            public const string AddGuidColumn = "meta_add_guid_column";

            /// <summary>
            ///   The name of the procedure that sets guid table column default value.
            /// </summary>
            public const string SetGuidDefault = "meta_set_guid_default";

            /// <summary>
            ///   The name of the procedure that creates a timespan table column.
            /// </summary>
            public const string AddTimeSpanColumn = "meta_add_timespan_column";

            /// <summary>
            ///   The name of the procedure that sets timespan table column default value.
            /// </summary>
            public const string SetTimeSpanDefault = "meta_set_timespan_default";

            /// <summary>
            ///   The name of the procedure that creates a text table column.
            /// </summary>
            public const string AddTextColumn = "meta_add_text_column";

            /// <summary>
            ///   The name of the procedure that creates a table index.
            /// </summary>
            public const string AddIndex = "meta_add_index";

            /// <summary>
            ///   The name of the procedure that deletes a table index.
            /// </summary>
            public const string DeleteIndex = "meta_delete_index";

            /// <summary>
            ///   The name of the procedure that creates a business unit.
            /// </summary>
            public const string AddUnit = "meta_add_unit";

            /// <summary>
            ///   The name of the procedure that deletes a business unit.
            /// </summary>
            public const string DeleteUnit = "meta_delete_unit";

            /// <summary>
            ///   The name of the procedure that adds a parent business unit.
            /// </summary>
            public const string AddUnitParent = "meta_add_unit_parent";

            /// <summary>
            ///   The name of the procedure that deletes a parent business unit.
            /// </summary>
            public const string DeleteUnitParent = "meta_delete_unit_parent";

            /// <summary>
            ///   The name of the procedure that creates a new security role.
            /// </summary>
            public const string AddRole = "meta_add_role";

            /// <summary>
            ///   The name of the procedure that deletes a security role.
            /// </summary>
            public const string DeleteRole = "meta_delete_role";

            /// <summary>
            ///   The name of the procedure that returns the current user.
            /// </summary>
            public const string GetCurrentUser = "meta_get_current_user";

            /// <summary>
            ///   The name of the procedure that creates a new user.
            /// </summary>
            public const string AddUser = "meta_add_user";

            /// <summary>
            ///   The name of the procedure that deletes a user.
            /// </summary>
            public const string DeleteUser = "meta_delete_user";

            /// <summary>
            ///   The name of the procedure that sets user logon ability.
            /// </summary>
            public const string SetUserCanLogon = "meta_set_user_login";

            /// <summary>
            ///   The name of the procedure that sets user ability to change the schema.
            /// </summary>
            public const string SetUserCanChangeSchema = "meta_set_user_change_schema";

            /// <summary>
            ///   The name of the procedure that sets user ability to change security settings.
            /// </summary>
            public const string SetUserCanChangeSecurity = "meta_set_user_change_security";

            /// <summary>
            ///   The name of the procedure that adds a user in a business unit.
            /// </summary>
            public const string AddUserUnit = "meta_add_user_unit";

            /// <summary>
            ///   The name of the procedure that deletes a user from from a business unit.
            /// </summary>
            public const string DeleteUserUnit = "meta_delete_user_unit";

            /// <summary>
            ///   The name of the procedure that adds a user in a security role.
            /// </summary>
            public const string AddUserInRole = "meta_add_user_in_role";

            /// <summary>
            ///   The name of the procedure that deletes a user from a security role.
            /// </summary>
            public const string DeleteUserFromRole = "meta_delete_user_from_role";

            /// <summary>
            ///   The name of the procedure that adds one security role into another.
            /// </summary>
            public const string AddRoleInRole = "meta_add_role_in_role";

            /// <summary>
            ///   The name of the procedure that deletes one security role from another.
            /// </summary>
            public const string RemoveRoleFromRole = "meta_delete_role_from_role";

            /// <summary>
            ///   The name of the procedure that grants a table access permission.
            /// </summary>
            public const string GrantTablePermission = "meta_add_table_rights";

            /// <summary>
            ///   The name of the procedure that revokes a table access permission.
            /// </summary>
            public const string RevokeTablePermission = "meta_delete_table_rights";

            /// <summary>
            ///   The name of the procedure that changes user password.
            /// </summary>
            public const string ChangeUserPassword = "meta_set_user_password";

            /// <summary>
            ///   The name of the procedure that changes the current user password.
            /// </summary>
            public const string ChangeCurrentUserPassword = "meta_set_curr_user_password";

            /// <summary>
            ///   The name of the procedure that appends data to a binary table column.
            /// </summary>
            public const string AppendBinaryData = "meta_append_binary";

            /// <summary>
            ///   The name of the procedure that appends data to a binary internal table column.
            /// </summary>
            public const string AppendBinaryDataInternally = "meta_append_binary_internal";

            /// <summary>
            ///   The name of the procedure that appends data to a text table column.
            /// </summary>
            public const string AppendTextData = "meta_append_text";

            /// <summary>
            ///   The name of the procedure that appends data to a text internal table column.
            /// </summary>
            public const string AppendTextDataInternally = "meta_append_text_internal";

            /// <summary>
            ///   The name of the procedure that soft deletes a table row.
            /// </summary>
            public const string SoftDeleteTableRow = "meta_soft_delete_table_row";

            /// <summary>
            ///   The name of the procedure that delete a table row.
            /// </summary>
            public const string DeleteTableRow = "meta_delete_table_row";

            /// <summary>
            ///   The name of the procedure that restores a table row.
            /// </summary>
            public const string RestoreTableRow = "meta_restore_table_row";

            /// <summary>
            ///   The name of the procedure that enables/disables table unit level security.
            /// </summary>
            public const string SetTableUnitLevelSecurity = "meta_set_unit_security";

            /// <summary>
            ///   The name of the procedure that enables/disables the recycle bin.
            /// </summary>
            public const string SetRecycleBin = "meta_set_recycle_bin";
        }


        /// <summary>
        ///   Database table constants.
        /// </summary>
        public abstract class Tables
        {
            /// <summary>
            ///   The prefix used for internal table name.
            /// </summary>
            public const string Prefix = "tbl_";


            /// <summary>
            ///   Big integer column table constants.
            /// </summary>
            public abstract class BigIntegerColumnList
            {
                /// <summary>
                ///   The big integer column table name.
                /// </summary>
                public const string Name = "meta_big_int_columns";


                /// <summary>
                ///   Big integer column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The maximum value column name.
                    /// </summary>
                    public const string Maximum = "maximum";

                    /// <summary>
                    ///   The minimum value column name.
                    /// </summary>
                    public const string Minimum = "minimum";
                }
            }


            /// <summary>
            ///   Binary column table constants.
            /// </summary>
            public abstract class BinaryColumnList
            {
                /// <summary>
                ///   The binary column table name.
                /// </summary>
                public const string Name = "meta_binary_columns";
            }


            /// <summary>
            ///   Boolean column table constants.
            /// </summary>
            public abstract class BooleanColumnList
            {
                /// <summary>
                ///   The boolean column table name.
                /// </summary>
                public const string Name = "meta_bool_columns";


                /// <summary>
                ///   Boolean column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";
                }
            }


            /// <summary>
            ///   Column list table constants.
            /// </summary>
            public abstract class ColumnList
            {
                /// <summary>
                ///   Column list column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The column id column name.
                    /// </summary>
                    public const string ColumnId = "column_id";

                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The column name column name.
                    /// </summary>
                    public const string ColumnName = "column_name";

                    /// <summary>
                    ///   The column display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";

                    /// <summary>
                    ///   The column decription column name.
                    /// </summary>
                    public const string Description = "description";

                    /// <summary>
                    ///   The column order index column name.
                    /// </summary>
                    public const string OrderIndex = "order_index";

                    /// <summary>
                    ///   The column nullability column name.
                    /// </summary>
                    public const string IsNotNull = "is_not_null";

                    /// <summary>
                    ///   The column customization level column name.
                    /// </summary>
                    public const string CustomizationLevel = "customization_level";
                }
            }


            /// <summary>
            ///   DateTime column table constants.
            /// </summary>
            public abstract class DateTimeColumnList
            {
                /// <summary>
                ///   The DateTime column table name.
                /// </summary>
                public const string Name = "meta_datetime_columns";


                /// <summary>
                ///   DateTime column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The maximum value column name.
                    /// </summary>
                    public const string Maximum = "maximum";

                    /// <summary>
                    ///   The minimum value column name.
                    /// </summary>
                    public const string Minimum = "minimum";
                }
            }


            /// <summary>
            ///   Database feature table constants.
            /// </summary>
            public abstract class DbmsFeatureList
            {
                /// <summary>
                ///   The database feature list table name.
                /// </summary>
                public const string Name = "meta_dbms_features";


                /// <summary>
                ///   The database feature list table columns.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The feature name column name.
                    /// </summary>
                    public const string FeatureName = "feature_name";

                    /// <summary>
                    ///   The availability column name.
                    /// </summary>
                    public const string IsEnabled = "is_enabled";
                }


                /// <summary>
                ///   Feature names.
                /// </summary>
                public abstract class FeatureNames
                {
                    /// <summary>
                    ///   The column renaming feature name.
                    /// </summary>
                    public const string ColumnRenaming = "COLUMN_RENAMING";
                }
            }


            /// <summary>
            ///   Decimal column table constants.
            /// </summary>
            public abstract class DecimalColumnList
            {
                /// <summary>
                ///   The decimal column table name.
                /// </summary>
                public const string Name = "meta_decimal_columns";


                /// <summary>
                ///   Decimal column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The maximum value column name.
                    /// </summary>
                    public const string Maximum = "maximum";

                    /// <summary>
                    ///   The minimum value column name.
                    /// </summary>
                    public const string Minimum = "minimum";

                    /// <summary>
                    ///   The precision column name.
                    /// </summary>
                    public const string Precision = "precision";

                    /// <summary>
                    ///   The scale column name.
                    /// </summary>
                    public const string Scale = "scale";
                }
            }


            /// <summary>
            ///   Enumeration column table constants.
            /// </summary>
            public abstract class EnumerationColumnList
            {
                /// <summary>
                ///   The enumeration column table name.
                /// </summary>
                public const string Name = "meta_enum_columns";


                /// <summary>
                ///   Enumartion column table specific column names
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The availability of the enum value checking column name.
                    /// </summary>
                    public const string HasValueChecking = "value_checking";
                }
            }


            /// <summary>
            ///   Enumeration member table constants.
            /// </summary>
            public abstract class EnumerationMemberList
            {
                /// <summary>
                ///   The enumeration member table name.
                /// </summary>
                public const string Name = "meta_enum_members";


                /// <summary>
                ///   Enumeration member table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The column id column name.
                    /// </summary>
                    public const string ColumnId = "column_id";

                    /// <summary>
                    ///   The member value column name.
                    /// </summary>
                    public const string Value = "value";

                    /// <summary>
                    ///   The member display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";
                }
            }


            /// <summary>
            ///   Guid column table constants.
            /// </summary>
            public abstract class GuidColumnList
            {
                /// <summary>
                ///   The guid column table name.
                /// </summary>
                public const string Name = "meta_guid_columns";


                /// <summary>
                ///   Guid column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";
                }
            }


            /// <summary>
            ///   Index table constants
            /// </summary>
            public abstract class IndexList
            {
                /// <summary>
                ///   The index table name.
                /// </summary>
                public const string Name = "meta_indexes";


                /// <summary>
                ///   Index table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The index id column name.
                    /// </summary>
                    public const string IndexId = "index_id";

                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The column id list column name.
                    /// </summary>
                    public const string ColumnIdList = "column_id_list";

                    /// <summary>
                    ///   The column uniqueness column name.
                    /// </summary>
                    public const string IsUnique = "is_unique";
                }
            }


            /// <summary>
            ///   Integer column table constants.
            /// </summary>
            public abstract class IntegerColumnList
            {
                /// <summary>
                ///   The integer column table name.
                /// </summary>
                public const string Name = "meta_int_columns";


                /// <summary>
                ///   Integer column table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The maximum value column name.
                    /// </summary>
                    public const string Maximum = "maximum";

                    /// <summary>
                    ///   The minimum value column name.
                    /// </summary>
                    public const string Minimum = "minimum";
                }
            }


            /// <summary>
            ///   Reference column table constants.
            /// </summary>
            public abstract class ReferenceColumnList
            {
                /// <summary>
                ///   The reference column table name.
                /// </summary>
                public const string Name = "meta_ref_columns";


                /// <summary>
                ///   Reference column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The status of the reference checking trigger.
                    /// </summary>
                    public const string HasReferenceChecking = "ref_checking";
                }
            }


            /// <summary>
            ///   Reference target table constants
            /// </summary>
            public abstract class ReferenceTargetList
            {
                /// <summary>
                ///   The reference target table name.
                /// </summary>
                public const string Name = "meta_ref_targets";


                /// <summary>
                ///   Reference target table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The column id column name.
                    /// </summary>
                    public const string ColumnId = "column_id";

                    /// <summary>
                    ///   The referenced table id column name.
                    /// </summary>
                    public const string ReferencedTableId = "ref_table_id";

                    /// <summary>
                    ///   The cascade delete column name.
                    /// </summary>
                    public const string HasCascadeDelete = "cascade_delete";
                }
            }


            /// <summary>
            ///   Role table constants.
            /// </summary>
            public abstract class RoleList
            {
                /// <summary>
                ///   The role table name.
                /// </summary>
                public const string Name = "meta_roles";


                /// <summary>
                ///   Role table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The role name column name.
                    /// </summary>
                    public const string RoleName = "role_name";

                    /// <summary>
                    ///   The display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";
                }
            }


            /// <summary>
            ///   Role roles table constants.
            /// </summary>
            public abstract class RoleRolesList
            {
                /// <summary>
                ///   The role roles table name.
                /// </summary>
                public const string Name = "meta_role_roles";


                /// <summary>
                ///   Role roles table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The role name column name.
                    /// </summary>
                    public const string RoleName = "role_name";

                    /// <summary>
                    ///   The container role name column name.
                    /// </summary>
                    public const string ContainerRoleName = "container_role_name";
                }
            }


            /// <summary>
            ///   Small integer column table constants.
            /// </summary>
            public abstract class SmallIntegerColumnList
            {
                /// <summary>
                ///   The small integer column table name.
                /// </summary>
                public const string Name = "meta_small_int_columns";


                /// <summary>
                ///   Small integer column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The maximum value column name.
                    /// </summary>
                    public const string Maximum = "maximum";

                    /// <summary>
                    ///   The minimum value column name.
                    /// </summary>
                    public const string Minimum = "minimum";
                }
            }


            /// <summary>
            ///   String column table constants.
            /// </summary>
            public abstract class StringColumnList
            {
                /// <summary>
                ///   The string column table name.
                /// </summary>
                public const string Name = "meta_string_columns";


                /// <summary>
                ///   String column table specific column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The default value column name.
                    /// </summary>
                    public const string DefaultValue = "default_value";

                    /// <summary>
                    ///   The maximum string length column name.
                    /// </summary>
                    public const string MaxLength = "max_length";
                }
            }


            /// <summary>
            ///   Table access control table constants.
            /// </summary>
            public abstract class TableAcl
            {
                /// <summary>
                ///   The table access control table name.
                /// </summary>
                public const string Name = "meta_table_acl";


                /// <summary>
                ///   Table access control table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The principal name column name.
                    /// </summary>
                    public const string PrincipalName = "principal_name";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";

                    /// <summary>
                    ///   The access level column name.
                    /// </summary>
                    public const string AccessLevel = "access_level";
                }
            }


            /// <summary>
            ///   Acl full access table constants.
            /// </summary>
            public abstract class TableAclFullAccess
            {
                /// <summary>
                ///   The acl full access table name.
                /// </summary>
                public const string Name = "meta_table_acl_full_access";


                /// <summary>
                ///   Acl full access table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";
                }
            }


            /// <summary>
            ///   Acl own rows access table constants.
            /// </summary>
            public abstract class TableAclOwnRows
            {
                /// <summary>
                ///   The acl own rows access table name.
                /// </summary>
                public const string Name = "meta_table_acl_own_rows";


                /// <summary>
                ///   Acl own rows access table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";
                }
            }


            /// <summary>
            ///   Acl unit-level table constants.
            /// </summary>
            public abstract class TableAclUnitLevelAccess
            {
                /// <summary>
                ///   The acl matrix table name.
                /// </summary>
                public const string Name = "meta_table_acl_unit_access";


                /// <summary>
                ///   Acl matrix table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The unit id column name.
                    /// </summary>
                    public const string UnitId = "unit_id";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";
                }
            }


            /// <summary>
            ///   Table list table constants.
            /// </summary>
            public abstract class TableList
            {
                /// <summary>
                ///   The table list table name.
                /// </summary>
                public const string Name = "meta_tables";


                /// <summary>
                ///   Table list column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The table name column name.
                    /// </summary>
                    public const string TableName = "table_name";

                    /// <summary>
                    ///   The table display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";

                    /// <summary>
                    ///   The table description column name.
                    /// </summary>
                    public const string Description = "description";

                    /// <summary>
                    ///   Unit level security availability column name.
                    /// </summary>
                    public const string HasUnitLevelSecurity = "unit_level_security";
                }
            }


            /// <summary>
            ///   Text column table constants.
            /// </summary>
            public abstract class TextColumnList
            {
                /// <summary>
                ///   The text column table name.
                /// </summary>
                public const string Name = "meta_text_columns";
            }


            /// <summary>
            ///   Business unit table constants.
            /// </summary>
            public abstract class UnitList
            {
                /// <summary>
                ///   The business unit table name.
                /// </summary>
                public const string Name = "meta_units";


                /// <summary>
                ///   Business unit table columns.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The unit id column name.
                    /// </summary>
                    public const string UnitId = "unit_id";

                    /// <summary>
                    ///   The unit name column name.
                    /// </summary>
                    public const string UnitName = "unit_name";

                    /// <summary>
                    ///   The display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";
                }
            }


            /// <summary>
            ///   Business unit parents table.
            /// </summary>
            public abstract class UnitParentList
            {
                /// <summary>
                ///   The Business unit parents table name.
                /// </summary>
                public const string Name = "meta_unit_parents";


                /// <summary>
                ///   Business unit parents table columns.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The unit id column name.
                    /// </summary>
                    public const string UnitId = "unit_id";

                    /// <summary>
                    ///   The parent unit id column name.
                    /// </summary>
                    public const string ParentUnitId = "parent_unit_id";
                }
            }


            /// <summary>
            ///   User table constants.
            /// </summary>
            public abstract class UserList
            {
                /// <summary>
                ///   The user table name.
                /// </summary>
                public const string Name = "meta_users";


                /// <summary>
                ///   User table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";

                    /// <summary>
                    ///   The logon ability column name.
                    /// </summary>
                    public const string CanLogon = "can_login";

                    /// <summary>
                    ///   The permission to change security settings column name.
                    /// </summary>
                    public const string CanChangeSecurity = "can_change_security";

                    /// <summary>
                    ///   The permission to change the schema column name.
                    /// </summary>
                    public const string CanChangeSchema = "can_change_schema";
                }
            }


            /// <summary>
            ///   User roles table constants.
            /// </summary>
            public abstract class UserRolesList
            {
                /// <summary>
                ///   The user roles table name.
                /// </summary>
                public const string Name = "meta_user_roles";


                /// <summary>
                ///   User roles table columns.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The container role name column name.
                    /// </summary>
                    public const string ContainerRoleName = "container_role_name";
                }
            }


            /// <summary>
            ///   User-defined table constants.
            /// </summary>
            public abstract class UserTable
            {
                /// <summary>
                ///   User-defined table column constants.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The unique identifier column name.
                    /// </summary>
                    public const string Id = "id";

                    /// <summary>
                    ///   The row owner column name.
                    /// </summary>
                    public const string Owner = "owner";

                    /// <summary>
                    ///   The row status column name.
                    /// </summary>
                    public const string IsActive = "is_active";

                    /// <summary>
                    ///   The row creator column name.
                    /// </summary>
                    public const string CreatedBy = "created_by";

                    /// <summary>
                    ///   The row creation datetime column name.
                    /// </summary>
                    public const string CreatedOn = "created_on";

                    /// <summary>
                    ///   The row updator column name.
                    /// </summary>
                    public const string UpdatedBy = "updated_by";

                    /// <summary>
                    ///   The row last modification datetime column name.
                    /// </summary>
                    public const string UpdatedOn = "updated_on";

                    /// <summary>
                    ///   The row deletor column name.
                    /// </summary>
                    public const string DeletedBy = "deleted_by";

                    /// <summary>
                    ///   The row deletion datetime column name.
                    /// </summary>
                    public const string DeletedOn = "deleted_on";

                    /// <summary>
                    ///   The row version column name.
                    /// </summary>
                    public const string RowVersion = "row_version";
                }
            }


            /// <summary>
            ///   User units table constants.
            /// </summary>
            public abstract class UserUnitList
            {
                /// <summary>
                ///   The user units table name.
                /// </summary>
                public const string Name = "meta_user_units";


                /// <summary>
                ///   User units table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The unit id column name.
                    /// </summary>
                    public const string UnitId = "unit_id";
                }
            }


            /// <summary>
            ///   Metadata version table constants.
            /// </summary>
            public abstract class MetadataVersion
            {
                /// <summary>
                ///   The metadata version table name.
                /// </summary>
                public const string Name = "meta_version";

                /// <summary>
                ///   Metadata version table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The major version column name.
                    /// </summary>
                    public const string Major = "major";

                    /// <summary>
                    ///   The minor version column name.
                    /// </summary>
                    public const string Minor = "minor";
                }
            }


            /// <summary>
            ///   Options table constants.
            /// </summary>
            public abstract class OptionList
            {
                /// <summary>
                ///   The options table name.
                /// </summary>
                public const string Name = "meta_options";


                /// <summary>
                ///   Options table column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The option name column name.
                    /// </summary>
                    public const string OptionName = "option_name";

                    /// <summary>
                    ///   The integer value column name.
                    /// </summary>
                    public const string IntegerValue = "int_value";
                }

                /// <summary>
                ///   Option names constants.
                /// </summary>
                public abstract class OptionNames
                {
                    /// <summary>
                    ///   The name of the option that enables/disables the recycle bin.
                    /// </summary>
                    public const string HasRecycleBin = "RECYCLE_BIN";
                }
            }
        }


        /// <summary>
        ///   Database view constants.
        /// </summary>
        public abstract class Views
        {
            /// <summary>
            ///   Table column view constants.
            /// </summary>
            public abstract class ColumnList
            {
                /// <summary>
                ///   The table column view name.
                /// </summary>
                public const string Name = "meta_table_columns";


                /// <summary>
                ///   Table column view column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The table name column name.
                    /// </summary>
                    public const string TableName = "table_name";

                    /// <summary>
                    ///   The column id column name.
                    /// </summary>
                    public const string ColumnId = "column_id";

                    /// <summary>
                    ///   The column name column name.
                    /// </summary>
                    public const string ColumnName = "column_name";

                    /// <summary>
                    ///   The column display name column name.
                    /// </summary>
                    public const string ColumnDisplayName = "display_name";

                    /// <summary>
                    ///   The column description column name.
                    /// </summary>
                    public const string ColumnDescription = "description";

                    /// <summary>
                    ///   The column nullability column name.
                    /// </summary>
                    public const string ColumnIsNotNull = "is_not_null";

                    /// <summary>
                    ///   The column order index column name.
                    /// </summary>
                    public const string ColumnOrderIndex = "order_index";

                    /// <summary>
                    ///   The column customization level column name.
                    /// </summary>
                    public const string ColumnCustomizationLevel = "customization_level";

                    /// <summary>
                    ///   The column type column name.
                    /// </summary>
                    public const string ColumnType = "column_type";
                }
            }


            /// <summary>
            ///   Current user view constants.
            /// </summary>
            public abstract class CurrentUser
            {
                /// <summary>
                ///   The current user view name.
                /// </summary>
                public const string Name = "meta_current_user";

                /// <summary>
                ///   Current user view column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";

                    /// <summary>
                    ///   The logon ability column name.
                    /// </summary>
                    public const string CanLogon = "can_login";

                    /// <summary>
                    ///   The permission to change security settings column name.
                    /// </summary>
                    public const string CanChangeSecurity = "can_change_security";

                    /// <summary>
                    ///   The permission to change the schema column name.
                    /// </summary>
                    public const string CanChangeSchema = "can_change_schema";
                }
            }


            /// <summary>
            ///   Principal view constants.
            /// </summary>
            public abstract class PrincipalList
            {
                /// <summary>
                ///   The principal view name.
                /// </summary>
                public const string Name = "meta_principals";


                /// <summary>
                ///   Principal view column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The principal name column name.
                    /// </summary>
                    public const string PrincipalName = "principal_name";

                    /// <summary>
                    ///   The display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";

                    /// <summary>
                    ///   The principal type column name.
                    /// </summary>
                    public const string PrincipalType = "principal_type";
                }


                /// <summary>
                ///   Principal types names.
                /// </summary>
                public abstract class PrincipalTypes
                {
                    /// <summary>
                    ///   The role principal type name.
                    /// </summary>
                    public const string Role = "role";

                    /// <summary>
                    ///   The user principal type name.
                    /// </summary>
                    public const string User = "user";
                }
            }


            /// <summary>
            ///   User name view constants.
            /// </summary>
            public abstract class UserNameList
            {
                /// <summary>
                ///   The user name view name.
                /// </summary>
                public const string Name = "meta_user_names";


                /// <summary>
                ///   User name view column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The user name column name.
                    /// </summary>
                    public const string UserName = "user_name";

                    /// <summary>
                    ///   The display name column name.
                    /// </summary>
                    public const string DisplayName = "display_name";
                }
            }


            /// <summary>
            ///   Current user acl full access view constants.
            /// </summary>
            public abstract class UserTableAclFullAccess
            {
                /// <summary>
                ///   The current user acl full access view name.
                /// </summary>
                public const string Name = "meta_user_acl_full_access";


                /// <summary>
                ///   Current user acl full access column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";
                }
            }


            /// <summary>
            ///   Current user acl own rows access view constants.
            /// </summary>
            public abstract class UserTableAclOwnRows
            {
                /// <summary>
                ///   The current user acl own rows access view name.
                /// </summary>
                public const string Name = "meta_user_acl_own_rows";


                /// <summary>
                ///   Current user acl own rows access column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";
                }
            }


            /// <summary>
            ///   Current user acl unit-level access view constants.
            /// </summary>
            public abstract class UserTableAclUnitAccess
            {
                /// <summary>
                ///   The current user acl unit-level access view name.
                /// </summary>
                public const string Name = "meta_user_acl_unit_access";


                /// <summary>
                ///   Current user acl unit-level access column names.
                /// </summary>
                public abstract class Col
                {
                    /// <summary>
                    ///   The table id column name.
                    /// </summary>
                    public const string TableId = "table_id";

                    /// <summary>
                    ///   The unit id column name.
                    /// </summary>
                    public const string UnitId = "unit_id";

                    /// <summary>
                    ///   The access type column name.
                    /// </summary>
                    public const string DataAction = "access_type";
                }
            }
        }
    }
}